$OpenBSD: patch-ospfd_ospf_network_c,v 1.1 2013/01/04 00:24:10 sthen Exp $

Revert 69bf3a39; does not work on at least (Open/Net)BSD.
This can be put back if we get RFC3678 support.

--- ospfd/ospf_network.c.orig	Tue Apr 17 14:56:26 2012
+++ ospfd/ospf_network.c	Thu Jan  3 00:24:26 2013
@@ -52,8 +52,8 @@ ospf_if_add_allspfrouters (struct ospf *top, struct pr
 {
   int ret;
   
-  ret = setsockopt_ipv4_multicast (top->fd, IP_ADD_MEMBERSHIP,
-                                   htonl (OSPF_ALLSPFROUTERS),
+  ret = setsockopt_multicast_ipv4 (top->fd, IP_ADD_MEMBERSHIP,
+                                   p->u.prefix4, htonl (OSPF_ALLSPFROUTERS),
                                    ifindex);
   if (ret < 0)
     zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
@@ -73,8 +73,8 @@ ospf_if_drop_allspfrouters (struct ospf *top, struct p
 {
   int ret;
 
-  ret = setsockopt_ipv4_multicast (top->fd, IP_DROP_MEMBERSHIP,
-                                   htonl (OSPF_ALLSPFROUTERS),
+  ret = setsockopt_multicast_ipv4 (top->fd, IP_DROP_MEMBERSHIP,
+                                   p->u.prefix4, htonl (OSPF_ALLSPFROUTERS),
                                    ifindex);
   if (ret < 0)
     zlog_warn ("can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %s, "
@@ -94,8 +94,8 @@ ospf_if_add_alldrouters (struct ospf *top, struct pref
 {
   int ret;
 
-  ret = setsockopt_ipv4_multicast (top->fd, IP_ADD_MEMBERSHIP,
-                                   htonl (OSPF_ALLDROUTERS),
+  ret = setsockopt_multicast_ipv4 (top->fd, IP_ADD_MEMBERSHIP,
+                                   p->u.prefix4, htonl (OSPF_ALLDROUTERS),
                                    ifindex);
   if (ret < 0)
     zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
@@ -115,8 +115,8 @@ ospf_if_drop_alldrouters (struct ospf *top, struct pre
 {
   int ret;
 
-  ret = setsockopt_ipv4_multicast (top->fd, IP_DROP_MEMBERSHIP,
-                                   htonl (OSPF_ALLDROUTERS),
+  ret = setsockopt_multicast_ipv4 (top->fd, IP_DROP_MEMBERSHIP,
+                                   p->u.prefix4, htonl (OSPF_ALLDROUTERS),
                                    ifindex);
   if (ret < 0)
     zlog_warn ("can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %s, "
@@ -151,7 +151,8 @@ ospf_if_ipmulticast (struct ospf *top, struct prefix *
     zlog_warn ("can't setsockopt IP_MULTICAST_TTL(1) for fd %d: %s",
 	       top->fd, safe_strerror (errno));
 
-  ret = setsockopt_ipv4_multicast_if (top->fd, ifindex);
+  ret = setsockopt_multicast_ipv4 (top->fd, IP_MULTICAST_IF,
+                                   p->u.prefix4, 0, ifindex);
   if (ret < 0)
     zlog_warn("can't setsockopt IP_MULTICAST_IF(fd %d, addr %s, "
 	      "ifindex %u): %s",
